﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace MyERP.Models
{
    /// <summary>
    /// 销售单实体类
    /// </summary>
    public class SalesTicket
    {
        public string Id { get; set; }
        public string ClientName { get; set; }
        public DateTime CreateDateTime { get; set; }
        public string GoodsName { get; set; }
        public int Number { get; set; }
        public double Price { get; set; }
        public double Money { get; set; }
        /// <summary>
        /// 单据创建时间
        /// </summary>
        public DateTime DateTimeNow { get; set; } = DateTime.Now;
    }
    public class SalesTicketConfig : IEntityTypeConfiguration<SalesTicket>
    {
        public void Configure(EntityTypeBuilder<SalesTicket> builder)
        {
            builder.ToTable("T_SalesTicket");
            builder.Property(e => e.ClientName).HasMaxLength(20);
            builder.Property(e => e.GoodsName).HasMaxLength(20);
        }
    }
}
